#include"process.h"



char buf[101];
char ch = '#';

int Index = 0;

void updateprocessbar(double _target,double _cur)
{
    memset(buf,0,sizeof(buf));
    std:: string s = "/-\\|";
    size_t len = s.size();
    double rate = (_cur / _target) * 100;
    int cnt = (int)rate;
    for(int i = 0;i<cnt;i++)
    {
        buf[i] = ch; 
    }

    printf("[%-100s][%d%%][%c]\r",buf,cnt,s[Index % len - 1]);
    fflush(stdout);
    Index++;
}
